package com.xbdun.web.validatebmp.upload.core.service;

import java.io.InputStream;
import java.util.List;
import java.util.Map;

import com.xbdun.facade.validatebmp.constant.WatermarkPostion;
import com.xbdun.facade.validatebmp.exceptions.ValidateBizException;
import com.xbdun.facade.validatebmp.menus.UploadFileFormat;
import com.xbdun.facade.validatebmp.upload.core.UploadFileBASE64;
import com.xbdun.facade.validatebmp.upload.core.UploadVo;
import com.xbdun.facade.validatebmp.upload.result.UploadOpenResult;
import com.xbdun.web.validatebmp.upload.core.UploadFile;
/***
 * 文件上传业务接口
 */
public interface UploadOpenService {
	
	/**
	 * 上传文件 base64
	 * @Title:uploadByBASE64
	 * @Description: TODO
	 * @param watermarkPostion 水印位置{@link WatermarkPostion}
	 * @param apiClientNo API客户端编号
	 * @param upFile  BASE64上传文件类{@link UploadFileBASE64}
	 * @return 上传文件结果{@link UploadOpenResult}
	 * @throws UploadFileError 
	 */
	public UploadOpenResult uploadByBASE64(WatermarkPostion watermarkPostion,String apiClientNo,UploadFileBASE64 upFile)throws ValidateBizException;
	/**
	 * 上传文件
	 * @param upfmt				希望返回的图片大小
	 * @param watermarkPostion 水印位置{@link WatermarkPostion}
	 * @param apiClientNo API客户端编号
	 * @param upFile  {@link UploadFile}
	 * @param inputStream 文件输入流
	 * @return 上传文件结果{@link UploadVo},id,url
	 * @throws UploadFileError
	 */
	public UploadVo upload(String upfmt,WatermarkPostion watermarkPostion,String apiClientNo,UploadFile upFile,InputStream inputStream)throws ValidateBizException;
	/**
	 * 获取上传文件URL地址
	 * @param id 上传文件Id
	 * @param uploadFileFormat 规格{@link UploadFileFormat}
	 * @return URL地址
	 * @throws UploadFileError
	 */
	public String getUrl(long id,UploadFileFormat uploadFileFormat)throws ValidateBizException;
	/**
	 * 获取上传文件URL地址
	 * @param uploadFileFormat 规格{@link UploadFileFormat}
	 * @param ids 多个上传文件Id
	 * @return {@link List<UploadVo>},UploadVo<id,url>
	 * @throws UploadFileError
	 */
	public List<UploadVo> getUrls(UploadFileFormat uploadFileFormat,long ...ids)throws ValidateBizException;
	/**
	 * 获取上传文件URL地址
	 * @param uploadFileFormat 规格{@link UploadFileFormat}
	 * @param ids 上传文件Id字符串，多个Id用英文逗号隔开
	 * @return {@link List<UploadVo>},UploadVo<id,url>
	 * @throws UploadFileError
	 */
	public List<UploadVo> getUrlByIds(UploadFileFormat uploadFileFormat,String ids)throws ValidateBizException;
	/**
	 * 获取上传文件URL地址
	 * @param uploadFileFormat 规格{@link UploadFileFormat}
	 * @param ids 多个上传文件Id
	 * @return  Map<上传文件Id,URL>
	 */
	public Map<Long,String> getUrlsMap(UploadFileFormat uploadFileFormat,long ...ids);
	/**
	 * 获取上传文件URL地址
	 * @param uploadFileFormat
	 * @param ids   上传文件Id字符串，多个Id用英文逗号隔开
	 * @return Map<上传文件Id,URL>
	 */
	public Map<Long,String> getUrlsMapIds(UploadFileFormat uploadFileFormat,String ids);
	/**
	 * 加载URL
	 * @param uploadFileReader {@link UploadFileReader<T>}
	 * @param uploadFileFormat {@link UploadFileFormat}
	 */
	@Deprecated
	public <T> void loadUrl(UploadFileReader<T> uploadFileReader,UploadFileFormat uploadFileFormat);
}
